package com.alkaid.commons.param.user;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.Pattern;

/**
 * @author Kylin
 * 发送验证码参数类
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class RegParam {
    @Pattern(regexp = "[^\\s\\\\~`!@#$%^&*(){}|/=+?<>'\";:]{2,16}",
            message = "昵称长度必须为2-16个字符，不可包含-和_以外的特殊字符")
    private String nickname;
    @Pattern(regexp = "^(?=.*[A-Z|a-z])(?=.*\\d)[A-Za-z\\d]{6,16}$",
            message = "密码必须由6-16个字符（至少1个字母、1个数字）组成，不能包含特殊字符（非数字字母）")
    private String password;
    @Pattern(regexp = "^((13[0-9])|(14[579])|(15[^4])|(18[0-9])|(17[0135678]))[0-9]{8}$", message = "手机号格式错误")
    private String mobile;
    @Pattern(regexp = "[0-9]{6}", message = "请填写完整验证码")
    private String smsCode;
}
